/**
 *  Filters JSON data for the login page; acts as a callback 
 *  function for ajax events
 *  
 **************************************************************
 *  Example
 **************************************************************
 *  // runs filter when jqXHR object has complete the AJAX call
 *  jqXHR.done( login_filter );
 *  
 **************************************************************
 *
 * @param {JSON} data the JSON data we wish to filter
 *
 * @author nicholas malacarne <nicholas.malacarne@gmail.com>
 */
function login_filter( data ){
    
    // if data is undefined, set as blank JSON -nm
    data = typeof data !== 'undefined' ? data : {};
    
    // if exception is returned from server -nm 
    if ( ( "exception" in data ) ){

        // log the exception -nm
        $.debugLog( data[ "exception" ] );

    }else if ( ( "account" in data ) ){ // if account data is found -nm

        // reload page -nm
        document.location.href = "index.html";
    }
    
    // show login/register div -nm
    $( '#login_reg_links' ).fadeIn();
    
}; // end function -nm